package com.twq;

/**
 * Created by tangweiqun on 2017/11/22.
 */
public class JavaSwitchTest {
    public static void main(String[] args) {
        int c = 1;
        //switch (selector) {alternatives}
        int result = -1;
        //selector也可以是一个可以计算出值(整型和字符串)的表达式
        switch (c) {
            case 1:
                result = 1;
                System.out.println("1111");
                break;
            case 2:
                result = 2;
                System.out.println("2222");
            case 3:
                result = 3;
                break;
            default:

        }

        System.out.println(result);

    }
}
